<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/3
 * Time: 10:12
 */

namespace app\index\model;

class User extends Base
{
    protected $table = 'sy_user';

    public function pAgent()
    {
        return $this->belongsTo('User', 'p_id', 'id');
    }

    public function gAgent()
    {
        return $this->belongsTo('User', 'g_id', 'id');
    }

    public function agent()
    {
        return $this->belongsTo('Agent', 'agent_id', 'id');
    }

    public function coupon()
    {
        return $this->belongsTo('Coupon','uid','id');
    }

}